set(BBN_SRCS
	BBN.cpp
	NFont.cpp
	Input.cpp
)
set(BBN_HDRS
	BBN.h
	NFont.h
)
set(BBN_install_HDRS
	BBN.h
)

set (BBN_OUTPUT_NAME "BBN")

# Build the shared library (.so or .dll)
if(BBN_BUILD_SHARED)
	add_library(BBN_shared SHARED
		${BBN_HDRS}
		${BBN_SRCS}
	)
	set_target_properties(BBN_shared PROPERTIES
		OUTPUT_NAME ${BBN_OUTPUT_NAME}
		CLEAN_DIRECT_OUTPUT 1
		VERSION ${BBN_VERSION}
	)
	if(MINGW)
      set_target_properties(BBN_shared PROPERTIES PREFIX "")
      set_target_properties(BBN_shared PROPERTIES IMPORT_PREFIX "")
    endif(MINGW)
	set_target_properties(BBN_shared PROPERTIES LINKER_LANGUAGE C)
endif()

# Build the static library (.a)
if(BBN_BUILD_STATIC)
	add_library(BBN STATIC
		${BBN_HDRS}
		${BBN_SRCS}
	)
	set_target_properties(BBN PROPERTIES
		OUTPUT_NAME ${BBN_OUTPUT_NAME}
		CLEAN_DIRECT_OUTPUT 1
		VERSION ${BBN_VERSION}
	)
	set_target_properties(BBN PROPERTIES LINKER_LANGUAGE C)
endif()

# These are used to create visual studio folders.
source_group(Common FILES ${BBN_SRCS} ${BBN_HDRS})

# Install the library
if(BBN_INSTALL)
	# install headers
	install(FILES ${BBN_install_HDRS} DESTINATION include/SDL)

	# install libraries
	if(BBN_BUILD_SHARED)
		install(TARGETS BBN_shared EXPORT BBN-targets DESTINATION lib)
	endif()
	if(BBN_BUILD_STATIC)
		install(TARGETS BBN EXPORT BBN-targets DESTINATION lib)
	endif()

	# install build system hooks for third-party apps
	#install(EXPORT BBN-targets DESTINATION ./BBN)
	#install(FILES BBNConfig.cmake DESTINATION ./BBN)
endif(BBN_INSTALL)
